package com.mfin.bom.objects;

// Generated 17 Jun, 2012 11:27:33 PM by Hibernate Tools 3.4.0.CR1

import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.AttributeOverride;
import javax.persistence.AttributeOverrides;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * FinanceChit generated by hbm2java
 */
@Entity
@Table(name = "finance_chit", catalog = "mfindb")
public class FinanceChit implements java.io.Serializable {

	private FinanceChitId id;
	private Customer customer;
	private Partner partner;
	private ChitMaster chitMaster;
	private Date doj;
	private Boolean flag;
	private Set<Cashbook> cashbooks = new HashSet<Cashbook>(0);

	public FinanceChit() {
	}

	public FinanceChit(FinanceChitId id, ChitMaster chitMaster) {
		this.id = id;
		this.chitMaster = chitMaster;
	}

	public FinanceChit(FinanceChitId id, Customer customer, Partner partner,
			ChitMaster chitMaster, Date doj, Boolean flag,
			Set<Cashbook> cashbooks) {
		this.id = id;
		this.customer = customer;
		this.partner = partner;
		this.chitMaster = chitMaster;
		this.doj = doj;
		this.flag = flag;
		this.cashbooks = cashbooks;
	}

	@EmbeddedId
	@AttributeOverrides({
			@AttributeOverride(name = "sno", column = @Column(name = "SNO", nullable = false)),
			@AttributeOverride(name = "chitId", column = @Column(name = "CHIT_ID", nullable = false)) })
	public FinanceChitId getId() {
		return this.id;
	}

	public void setId(FinanceChitId id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "CUSTOMER_ID")
	public Customer getCustomer() {
		return this.customer;
	}

	public void setCustomer(Customer customer) {
		this.customer = customer;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "REFERENCE_PARTNER_ID")
	public Partner getPartner() {
		return this.partner;
	}

	public void setPartner(Partner partner) {
		this.partner = partner;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "CHIT_ID", nullable = false, insertable = false, updatable = false)
	public ChitMaster getChitMaster() {
		return this.chitMaster;
	}

	public void setChitMaster(ChitMaster chitMaster) {
		this.chitMaster = chitMaster;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "DOJ", length = 19)
	public Date getDoj() {
		return this.doj;
	}

	public void setDoj(Date doj) {
		this.doj = doj;
	}

	@Column(name = "FLAG", columnDefinition = "BIT")
	public Boolean getFlag() {
		return this.flag;
	}

	public void setFlag(Boolean flag) {
		this.flag = flag;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "financeChit")
	public Set<Cashbook> getCashbooks() {
		return this.cashbooks;
	}

	public void setCashbooks(Set<Cashbook> cashbooks) {
		this.cashbooks = cashbooks;
	}

}
